import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:sp_util/sp_util.dart';

class Config {
  static const bool isDev = false;

  // 1:beta 2:uat 3:生产环境 4:test
  static const int env = 2;
  // static const int env = 1;

  // /// 接口地址
  // static const String baseUrl =
  //     isDev ? "https://api-2c-beta.zrhsh.com" : "https://api-2c-uat.zrhsh.com";
  // // static const String baseUrl = isDev ? "https://api-2c-uat.zrhsh.com" : "https://api-2c.zrhsh.com";
  static const String baseUrl = (env == 1)
      ? 'https://api-2c-beta.zrhsh.com'
      : (env == 2)
          ? 'https://api-2c-uat.zrhsh.com'
          : (env == 4)
              ? "https://api-2c-test.zrhsh.com"
              : 'https://api-2c.zrhsh.com';

  static const String apiHost = "$baseUrl/omp_cmanage/mallgateway";
  static const String apiHost1 = "$baseUrl/omp_cmanage/";
  static const String hashCode1 = (env == 1)
      ? 'nrp-beta'
      : (env == 4)
          ? "nrp-test"
          : 'nrp-zrhsh';

//   static const String hashCode1 = isDev ? 'nrp-beta' : 'nrp-zrhsh';
// //   static const String hashCode1 = 'nrp-zrhsh';

  // static const String CGHSHBaseUrl =
  //     isDev ? 'dstest.zrhsh.com' : 'zrds.zrhsh.com'; //测试环境：正式环境
  static const String CGHSHBaseUrl =
      (env == 3) ? 'zrds.zrhsh.com' : 'dstest.zrhsh.com';

  /// 友盟统计
  static const CGHSHUmengAppKeyForIOS = '610cafc53451547e683dd448';

  static const int use_plat_form = kIsWeb ? 1 : 2;

  static const CGHSHUmengAppKeyForAndroid = '610cacc93451547e683dc044';

  static const String PrivacyProtocol =
      'https://img.zrhsh.com/zrhshgg/treaty/yszc-hxk.html'; //隐私协议

  static const String ServiceProtocol =
      'https://img.zrhsh.com/zrhshgg/treaty/fwxy.html'; //服务协议
  /// 极光推送
  static const String JPUSH_APP_KEY = "e1878b00090af2b8441151d2";

  ///高德地图
  // static const String AMap_andriod = 'c68408ef889ed71d41817a200fe218fc';
  // static const String AMap_ios = '32fa3a9e1c00c4fc17131f51b17a1a31';
  // static const String AMap_andriod = 'c090eb8cce0cc360f6baa897b035444c';
  static const String AMap_andriod = 'c090eb8cce0cc360f6baa897b035444c';
  static const String AMap_ios = 'a573d29a579c01d13a64c923bc52590e';

  //企业包
  static const String AMap_ios_com = '4e695f76479fff4aff61eed67b34267d';
  static String AMap_ios_get = '';

  /// 极光推送
  static const int user_type = 2;

  /// 微信AppId（慧享客）
  // static const String WECHAT_APPID = "wxc534b3d5084f12b2";
  static const String ZJ_APPID = 'wxf6e85f0b41014cda';

  // wxf6e85f0b41014cda
  //wx0adf69880cb1a9eb  wxe410c560b76ef6e4
  static const String WECHAT_APPID = "wx0adf69880cb1a9eb";

  // static const String UNIVERSAL_LINK = "https://img.zrhsh.cn/hlskoc/";
  static const String UNIVERSAL_LINK = "https://img.zrhsh.cn/hshapp/";
  static const String WEB_URL = (env == 1)
      // ? "http://nrp3mall-beta.zrhsh.com/#/"
      ? "https://nrp3mall-beta.zrhsh.com/#/"
      : (env == 2)
          ? "https://nrp3mall-uat.zrhsh.com/#/"
          : (env == 4)
              ? "https://nrp3mall-beta.zrhsh.com/#/"
              : "https://nrp3mall.zrhsh.com/#/";
  static String H5_URL = (env == 1)
      // ? "http://nrp3mall-beta.zrhsh.com/#/"
      ? "https://nrp3mall-beta.zrhsh.com/jumpToMini.html?mberType=2&applyerId=" +
          SpUtil.getInt('empeNumId').toString() +
          "&applyer=" +
          SpUtil.getInt('empeNumId').toString()
      : (env == 2)
          ? "https://nrp3mall-uat.zrhsh.com/jumpToMini.html?mberType=2&applyerId=" +
              SpUtil.getInt('empeNumId').toString() +
              "&applyer=" +
              SpUtil.getInt('empeNumId').toString()
          : "https://nrp3mall.zrhsh.com/jumpToMini.html?mberType=2&applyerId=" +
              SpUtil.getInt('empeNumId').toString() +
              "&applyer=" +
              SpUtil.getInt('empeNumId').toString();
  static const String WEB_DOWN_URL = (env == 1)
      // ? "http://nrp3mall-beta.zrhsh.com/"
      ? "https://nrp3mall-beta.zrhsh.com/"
      : (env == 2)
          ? "https://nrp3mall-uat.zrhsh.com/"
          : (env == 4)
              ? "https://nrp3mall-beta.zrhsh.com/#/"
              : "https://nrp3mall.zrhsh.com/";

  /// 小程序appid
  static const String MINI_APPID = (env == 1)
      ? 'wxfe5df85e9c1be0d0'
      : (env == 2)
          ? 'wx9d3fe9fe204c367b'
          : (env == 4)
              ? 'wxfe5df85e9c1be0d0'
              : 'wxe4c6deb2da3535b2';

  /// 小程序account
  static const String MINI_ACCOUNT = (env == 1)
      ? 'gh_3f26a5714caa'
      : (env == 2)
          ? 'gh_77d7f2c7c096'
          : (env == 4)
              ? 'gh_3f26a5714caa'
              : 'gh_9cc9242654e2';

  /// 应用名字
  static const String APP_NAME = 'xxx';

  /// 资源路径
  static const String ASSETS_IMG = 'assets/images/';

  ///令牌名称
  static const String TOKEN = "token";

  ///用户信息缓存名称
  static const String USER_CACHE = "user-cache";

  /// 用户当前位置
  static const String USER_CURRENT_LOCATION = "user_current_location";

  /// 历史搜索
  static const String HISTORY_SEARCH_KEYWORD_LIST =
      "history_search_keyword_list";

  /// 接口验证通过时的返回码
  static const String API_SUCCESS_CODE = "0";

  /// 接口code对应字段名字
  static const String API_CODE_FIELD_NAME = "code";

  /// 接口message字段名
  static const String API_MESSAGE_FIELD_NAME = "message";

  /// 获取第三方店铺的信息
  static const String GET_SHOP_INFO = "getShopInfo";
  static const String IS_CHANGE_SHOP = "isChangeShop";

  /// 全局色调
  static const Color mainColor = Color(0xffEA5504); //

  /// appBar背景色
  static const Color appBarColor = Color(0xffffffff);

  /// 全局按钮颜色
  static const Color buttonColor = Color(0xff3A85FF);

  /// 全局按钮文字颜色
  static const Color buttonTextColor = Colors.white;

  /// 应用页面背景色
  static const Color bgColor = Color(0xfff7f7f7);

  ///登录界面样式:0、手机号登录 1、账号、密码登录
  static String loginScreenStyle = '1';

  /// 暂无数据图片
  static String orderEmpty =
      'https://api-2c.zrhsh.com/wechat_images/resource/images/orderEmpty.png';

  ///是否显示登录界面的防劫持提示
  static bool ShowLoginPageLeftTip = false;
}
